package com.project.erp.model.system;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.project.erp.model.IdEntity;

/**
 * 
 * COPYRIGHT (C) 2013 BY XXX公司

 *  功能模块名：系统管理-岗位管理

 *  功能描述：岗位褓类

 * @author LiJiaGuo    

 * @version 1.0  

 * @created 2013-11-30 下午11:57:32
 */

@Entity
@Table(name = "TBL_POST")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Posts extends IdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7907582869295372597L;

	private String postNum; // 岗位编号
	private String postName; // 岗位名称岗位编号
	private Department deptId; // 所属部门
	private String description; // 备注

	@Column(columnDefinition="varchar(30)")
	public String getPostNum() {
		return postNum;
	}

	public void setPostNum(String postNum) {
		this.postNum = postNum;
	}

	@Column(columnDefinition="varchar(80)")
	public String getPostName() {
		return postName;
	}

	public void setPostName(String postName) {
		this.postName = postName;
	}

	@ManyToOne
	@JoinColumn(name="dept_id",nullable=false)
	@org.hibernate.annotations.ForeignKey(name="fk_dept_post")
	@org.hibernate.annotations.Index(name="idx_fk_dept_post")
	public Department getDeptId() {
		return deptId;
	}

	public void setDeptId(Department deptId) {
		this.deptId = deptId;
	}

	@Column(columnDefinition="varchar(80)")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}
